# Contributor: Alex McGrath <amk@amk.ie>
# Maintainer: Alex McGrath <amk@amk.ie>
pkgname=py3-semver
_pkgname=python-semver
pkgver=3.0.2
pkgrel=0
pkgdesc="Python package to work with Semantic Versioning"
url="https://github.com/python-semver/python-semver"
arch="noarch"
license="BSD-3-Clause"
depends="python3"
makedepends="py3-gpep517 py3-wheel py3-setuptools"
checkdepends="py3-pytest-cov"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/python-semver/python-semver/archive/$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
7cc5d227c4a0ef7b61ca73a4c8c3eb6bbb48c2d73c8436c19edf151094ea77def071ee44ea580eb1d82ee31b7cd02cb1bd2fa85e9475d43c9693d7ff62f5ea21  py3-semver-3.0.2.tar.gz
"
